package net.huashitong.ssydt.user.entity.vo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import net.huashitong.ssydt.constants.SsydtConsts;
import net.huashitong.user.vo.UserRegisterInVO;
import org.hibernate.validator.constraints.NotEmpty;

/**
 * @author huiyang.yu
 */
@ApiModel(description = "注册入参")
public class RegisterVO extends BaseLoginVO {

    private static final long serialVersionUID = 8075183004846128274L;
    @ApiModelProperty(value = "手机号", required = true)
    @NotEmpty(message = "手机号码不能为空")
    private String mobile;//手机号码

    @ApiModelProperty(value = "密码（Base64加密）", required = true)
    @NotEmpty(message = "密码不能为空")
    private String password;//密码（Base64加密）

    @ApiModelProperty(value = "验证码", required = true)
    @NotEmpty(message = "验证码不能为空")
    private String vaildCode;//验证码

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getVaildCode() {
        return vaildCode;
    }

    public void setVaildCode(String vaildCode) {
        this.vaildCode = vaildCode;
    }

    public UserRegisterInVO getUserRegisterInVO(RegisterVO registerVO) {
        UserRegisterInVO userRegisterInVO = new UserRegisterInVO();
        userRegisterInVO.setMobile(registerVO.getMobile());
        userRegisterInVO.setPassword(registerVO.getPassword());
        userRegisterInVO.setTerminal(registerVO.getTerminal());
        userRegisterInVO.setDeviceCode(registerVO.getDeviceCode());
        userRegisterInVO.setDeviceType(registerVO.getDeviceType());
        userRegisterInVO.setDeviceOperation(registerVO.getDeviceOperation());
        userRegisterInVO.setClientVersion(registerVO.getClientVersion());
        userRegisterInVO.setProductSource(SsydtConsts.PRODUCT_CODE);
        return  userRegisterInVO;
    }
}
